<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>编辑</title>
    <link href="http://cdn.staticfile.org/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.staticfile.org/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/jquery.qeditor.css" type="text/css">
    <script src="/js/jquery-3.2.1.min.js"></script>
    <script src="/js/jquery.qeditor.js" ></script>
    <style type="text/css" media="screen">
        .textarea {
            background-color: #ffffff;
            border: 1px solid #cccccc;
            -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
            -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
            box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
            -webkit-transition: border linear .2s, box-shadow linear .2s;
            -moz-transition: border linear .2s, box-shadow linear .2s;
            -o-transition: border linear .2s, box-shadow linear .2s;
            transition: border linear .2s, box-shadow linear .2s;
            padding: 4px 6px;
            font-size: 14px;
            line-height: 20px;
            color: #555555;
            -webkit-border-radius: 4px;
            -moz-border-radius: 4px;
            border-radius: 4px;
            vertical-align: middle;
            outline: none;
            height: 400px;
        }
    </style>

</head>
<body>
<div class="container">
    <h1 class='text-center'>${plan.text}</h1>


    <form class="form-horizontal" >



        <div class="control-group">
            <h1 class='text-center'>编辑</h1>

            <div class="controls">
                <div class="input-group input-group-lg">
                    <span class="input-group-addon" id="sizing-addon1">主题</span>
                    <input id="titles" type="text" class="form-control" placeholder="" aria-describedby="sizing-addon1">
                </div>
                <textarea id="post_body" name="body" class="textarea" placeholder=""></textarea>
                <div class="input-group input-group-lg">
                    <span class="input-group-addon" id="sizing-addon2">关键字</span>
                    <input id="keywords" type="text" class="form-control" placeholder="" aria-describedby="sizing-addon1">
                </div>
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <button type="button" id="submit" class="btn btn-success">保存</button>
                <button type="button" class="btn" ><a href="/admin/contingencyPlan">取消</a></button>
            </div>
        </div>
    </form>
    <script type="text/javascript">
        $("#post_body").qeditor({});

        // Custom a toolbar icon
        var toolbar = $("#post_body").parent().find(".qeditor_toolbar");
        var link = $("<a href='#'><span class='icon-smile' title='smile'></span></a>");
        link.click(function(){
            alert("Put you custom toolbar event in here.");
            return false;
        });
        toolbar.append(link);

        // Custom Insert Image icon event
        function changeInsertImageIconWithCustomEvent() {
            var link = toolbar.find("a.qe-image");
            link.attr("data-action","");
            link.click(function(e){
                alert("New insert image event");
                return false;
            });
            alert("Image icon event has changed, you can click it to test");
            return false;
        }
        $(function () {
            window.location.href


            $("#submit").click(function(){
                var content1=$("#post_body").val()
                var  titles=$("#titles").val()
                var  keywords=$("#keywords").val()



                var searchMap = {
                    "content": content1,
                    "sep_id": "1",
                    "state": "0",
                    "tite": titles,
                    "userlogin_id": 1,
                    "userlogin_sep_repair": "1",
                    "userlogin_sep_submit": "1"
                };
                $.ajax({
                    url: '/eme/addsiblingnode',
                    type: "post",
                    dataType: "json",
                    data: JSON.stringify(searchMap),
                    contentType:"application/json;charset=UTF-8",
                    success: function () {
                        alert("保存成功")
                        window.location.href="/admin/contingencyPlan"

                    },
                    error: function () {
                        alert("保存失败")
                    }

                })
            });
        });
    </script>
</div>
</body>
</html>